package com.qf.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.qf.mapper.DtsGoodsMapper;
import com.qf.pojo.DtsGoods;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * projectName: shop-manage
 *
 * @author: 元
 * time: 2021/9/13 0013 19:19
 * description:
 */
@Service
public class GoodsServiceImpl implements GoodsService{
    @Autowired
    private DtsGoodsMapper dtsGoodsMapper;
    @Override
    public Integer goodsCount() {
        QueryWrapper<DtsGoods> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("deleted", 0);
        Integer selectCount = dtsGoodsMapper.selectCount(queryWrapper);
        return selectCount;
    }

    @Override
    public List<Map> statGoodsByDay() {
        List<Map> mapList = dtsGoodsMapper.queryAllGoods();
        return mapList;
    }
}
